package com.sojson.config.autoConfig.close.database;

import org.mybatis.spring.boot.autoconfigure.MybatisAutoConfiguration;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.boot.autoconfigure.jdbc.DataSourceTransactionManagerAutoConfiguration;
import org.springframework.context.annotation.Conditional;
import org.springframework.context.annotation.Configuration;

import com.sojson.config.autoConfig.close.database.condition.CloseDatabaseCondition;

/**
 * 关闭数据源的自动配置
 */
@Configuration
/** 是否注入这个Bean */
@Conditional(CloseDatabaseCondition.class)
/** EnableAutoConfiguration注解，关闭springBoot关于mybatis的一些自动注入,多数据源的时候要用 */
@EnableAutoConfiguration(exclude = {DataSourceAutoConfiguration.class,
    DataSourceTransactionManagerAutoConfiguration.class, MybatisAutoConfiguration.class})
public class CloseDatabaseAutoConfig {

}